// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import MuseUI from 'muse-ui'
import 'muse-ui/dist/muse-ui.css'
import axios from 'axios'
import store from './store'
import common from './common/common.js'

// var Base64 = require('js-base64').Base64
// Vue.prototype.Base64 = Base64

import { Toast } from 'vant'
Vue.use(Toast)
Vue.prototype.Toast = Toast
Vue.prototype.Toast.setDefaultOptions({
  duration: 0,
  mask: true
})
document.onclick = function (e) {
  if (e.target.className === 'van-modal' || e.target.className === 'van-overlay') { 
    Toast.clear() 
  }
}
Vue.prototype.common = common
Vue.prototype.$http = axios
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'

Vue.use(MuseUI)
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
